package com.system.vote.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.system.vote.admin.entity.SysRole;
import com.system.vote.admin.mapper.SysRoleMapper;
import com.system.vote.admin.service.SysRoleService;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 * @description 针对表【sys_role(角色表)】的数据库操作Service实现
 * @createDate 2023-10-19 11:49:14
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole>
        implements SysRoleService {

    @Override
    public SysRole getByRoleName(String name) {
        return getOne(new QueryWrapper<SysRole>().eq("name", name));

    }

    @Override
    public SysRole getByRoleCode(String code) {
        return getOne(new QueryWrapper<SysRole>().eq("code", code));
    }
}




